# -*- coding: utf-8 -*-
"""
Created by #zqy_TheBest on 2024/6/8
Description: 
"""

# Your code goes here
import json
import time
from .getPublicData import *

def getCenterChangeDate():
    cars = list(getAllCars())  # 假设 getAliCars() 函数返回一个汽车列表
    oil_data = []
    electric_data = []
    other_data = []

    for i in cars:
        if i.energytype and i.energytype.strip().lower() == "汽油":
            # 你的处理逻辑
            oil_data.append([i.carname, i.salevolume, i.energytype])
        elif i.energytype == "纯电动":  # 检查能源类型是否为 "纯电动"
            electric_data.append([i.carname, i.salevolume, i.energytype])
        else:
            other_data.append([i.carname, i.salevolume, i.energytype])

    oil_data = oil_data[:20]  # 假设我们只取前5个数据
    electric_data = electric_data[:20]  # 假设我们只取前10个数据
    other_data = other_data[:20]  # 假设我们只取前10个数据

    return oil_data, electric_data, other_data

